home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
SoftwareFPU 3.04 Folder.sit
/
SoftwareFPU 3.04 Folder
/
SoftwareFPU 3.04
/
SoftwareFPU Documentation
/
Programmer Info
(
.txt
)
< prev
Wrap
Common Ground
|
1996-04-23
|
17KB
|
127 lines
Times
John Neil & Associates
P.O. Box 2156
Cupertino, CA 95015 USA
Orders:
E-Mail:
Web Site:
(800) 663-2943
(415) 661-2944
sales@jna.com
http://www.jna.com
of 2
lUUUU
HUUUU
I$UUUU
------
<<<<<<
KKKKKK
ZZZZZZ
iiiiii
xxxxxx
Programmer Information
John Neil
April 23, 1996
What SoftwareFPU Does
YSoftwareFPU is a control panel which emulates a Motorola 68881 Floating Point Unit (FPU).
H¥It is intended to be used in any 68020, 68030, or 68LC040 Macintosh computer without an FPU.
^It can also be used on Power Macintosh machines, since the Apple 68K emulator does not emulate
_FPU instructions. It works by patching out the F-Line exception vector of the machine with one
1that points to FPU emulation code in SoftwareFPU.
/Differences Between a 68881 FPU and SoftwareFPU
RThe differences between the hardware FPU and SoftwareFPU are minimal. The current
H7differences between SoftwareFPU and a hardware FPU are:
/FRESTORE does not support the busy state frame.
GMid-instruction exceptions are reported as post-instruction exceptions.
ZIf an exception occurs in trace mode, two instructions will execute before control returns
to the debugger.
TCode which puts data below the stack pointer and then issues an FPU instruction will
Xnot work. This is of course a no-no since data below the stack pointer can be clobbered
by interrupt routines as well.
OSome emulated FPU instructions may produce slightly different results than on a
hardware FPU.
ZYIn addition, on PowerPC machines in 64-bit accuracy mode the following differences exist:
UThe rounding precision in the FPU Mode Control Byte is ignored. All calculations are
Pperformed as if double-precision rounding was selected in the Mode Control Byte.
SFor performance reasons, the PowerPC emulator cannot emulate address and bus errors
Xproperly. If an FPU instruction causes an address or bus error, the emulator will break
Pinto MacsBug at a location inside the emulator, rather than at the offending FPU
instruction.
Z<The current list of known application incompatibilities are:
IAny program which replaces the F-line exception vector will not work with
RSoftwareFPU. A typical example is a source-level debugger in a development system
Mlike MPW or THINK C/Symantec C++. SoftwareFPU 3.0 provides a new facility so
Times
John Neil & Associates
P.O. Box 2156
Cupertino, CA 95015 USA
Orders:
E-Mail:
Web Site:
(800) 663-2943
(415) 661-2944
sales@jna.com
http://www.jna.com
of 2
gXapplications like this can detect whether SoftwareFPU is installed, to determine whether
Bor not the F-Line exception vector should be replaced (see below).
QA bug in the MPW 3.1 nan() function means that any program calling nan() will not
Swork. Because of this, the MPW functions atan2(), asin(), and acos() will not work
Twhen they try to produce QNANs. Also, fscanf will not read in NANs correctly. The
bug has been fixed in MPW 3.2.
MCode which assumes that calls to SANE affect the FPU will not work. The MPW
[functions sinh() and cosh() may produce incorrect results in the exception status register,
*as the library code makes this assumption.
SCode that depends on 68882 or 68040 FPU stack frames or instructions will not work.
FSoftwareFPU currently only emulates a 68881 FPU, even on 68LC040 CPUs.
VApplications that depend upon a particular FPU should verify the type of FPU installed
with the
Courier
gestaltFPUType
Gestalt selector.
Performance
_Because of the overhead in emulating all the intricacies of the FPU, executing FPU instructions
HRthrough SoftwareFPU is slower than calling SANE. SoftwareFPU is aware of existing
[applications that can switch between hardware or software floating-point (such as Microsoft
SExcel), and does not report the presence of an FPU, so they will not slow down with
bSoftwareFPU installed. However, if you are writing a new application with this functionality, you
¥should check whether SoftwareFPU is installed using the new facility in SoftwareFPU 3.0 (see
0below) before selecting hardware floating point.
%Detecting the Presence of SoftwareFPU
YSoftwareFPU adds a new Gestalt selector when it is installed in the system. To determine
HIwhether SoftwareFPU is installed, simply make the following Gestalt call:
long response;
$result = Gestalt(
, &response);
If the result of the call is
noErr
;, then SoftwareFPU is installed, and the 68881 FPU reported
by the
gestaltFPUType
)TD selector is an emulated FPU. The value returned in the response is
H9private to John Neil & Associates, and should be ignored.
68LC040 CPU Chip Bug
MThe 68LC040 chip bug mentioned in the user documentation is that with certain
HXinstructions streams, pending CPU writes to memory never arrive when an F-Line exception
^occurs. Most Macintosh applications are not affected by the bug, since an F-Line exception is
Vnormally a fatal error. However, software that depends on F-Line exceptions, such as
WSoftwareFPU, will not work properly. There is no known work-around for the bug once an
Zexception has occurred (the only possible work-around that SoftwareFPU could use). At the
dapplication level, putting a NOP in front of every F-Line instruction will eliminate the problem, at
[the expense of reducing performance on machines with hardware FPUs. Despite this bug, some
[FPU applications still work with SoftwareFPU on 68LC040 machines, because their instruction
Ystreams do not trigger the bug. For more information on the bug, please contact Motorola
Semiconductor Inc.
*6(@4
=8 >+'
/ .#+
Dt p
temp.0001
John M. Neil
John M. Neil
Microsoft Word
Times
Courier
rPREC
~PRVS